package com.duoketech.model.activityorder;
import com.duoketech.model.AbstractModel;
import com.duoketech.utils.PageUtil;

public class ActivityOrder extends AbstractModel<ActivityOrder>{
    public static final ActivityOrder dao = new ActivityOrder();

    public static final int STATUS_UNPAY=0;
    public static final int STATUS_PAID=1;
    public static final int STATUS_CONFIRM=2;
    public static final int STATUS_CANCEL=3;

    public static final int CARD_TYPE_IDENTIFY=1;//身份证
    public static final int CARD_TYPE_PASSPORT=2;//护照
    public static final int CARD_TYPE_XXX=3;//港澳通行证

    public static final String ID = "id";//
    public static final String NAME = "name";//入驻人
    public static final String MOBILE = "mobile";//入驻人手机
    public static final String OBJ_ID = "obj_id";//客栈类型
    public static final String REMARKER = "remarker";//备注信息
    public static final String PRICE = "price";//价格
    public static final String MEMBER_ID = "member_id";//memberId
    public static final String CARD_TYPE = "card_type";//card_type
    public static final String CARD_NO = "card_no";//card_no
    public static final String UNIT_ID = "unit_id";//card_no
    public static final String ORDER_SN = "order_sn";//card_no
    @Override
    public String tableName() {
        return "t_order_activity";
    }

    @Override
    public String status() {

        String result="未知";
        if(getInt(STATUS)==STATUS_UNPAY){
            result="等待支付";
        }else if(getInt(STATUS)==STATUS_PAID) {
            result ="已支付";
        }else if(getInt(STATUS)==STATUS_CONFIRM){
            result="已确认";
        }else if(getInt(STATUS)==STATUS_CANCEL){
            result="取消报名";
        }
        return result;
    }


    public String cardType() {

        String result="未知";
        if(getInt(CARD_TYPE)==CARD_TYPE_IDENTIFY){
            result="身份证";
        }else if(getInt(CARD_TYPE)==CARD_TYPE_PASSPORT){
            result="护照";
        }else if(getInt(CARD_TYPE)==CARD_TYPE_XXX){
            result="台胞证";
        }
        return result;
    }

    public String createTime(){
        return PageUtil.formatDataYYMMDDHHMMSS(getDate(CREATE_TIME));
    }

    public String price(){
        return PageUtil.fengToYuan(getInt(PRICE))+"";
    }
}